package com.bawei.web;

import com.baidu.entity.Product;
import com.baidu.utils.ResultResponse;
import com.bawei.serves.ProductServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author lvchong
 * @Description: 修改
 * @Date: Created in 2021/12/13 9:46
 * @Modified By:
 */
@RestController
@Slf4j
@CrossOrigin
@RequestMapping("product")
public class ProductWeb {
    @Resource
    private ProductServer ss;
    @RequestMapping("list")
    public ResultResponse list(@RequestBody Product product){
        log.info("查询列表");
        return ss.list(product);
    }
    @RequestMapping("deletes")
    public ResultResponse deletes(@RequestBody Product product){
        log.info("执行逻辑删除{}",product.getPid());
        return ss.deletes(product);
    }
    @RequestMapping("updates")
    public ResultResponse updates(@RequestBody Product product){
        log.info("{}产品执行力修改，状态更改为0待审核",product.getPname());
        return ss.update(product);
    }
    @RequestMapping("adds")
    public ResultResponse adds(@RequestBody Product product){
        log.info("添加了{}商品状态值为0，待审核",product.getPname());
        return ss.adds(product);
    }
}
